//
//  SLNetWork.h
//  StarLight
//
//  Created by 吴涛 on 16/5/9.
//  Copyright © 2016年 Duke.Wu. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "AFNetworking.h"


#define baseUrl @"http://xinmatou.net/app"

#define kTimeOutInterval 30
/**
 *  接受数据后的回调
 *
 *  @param respond 接收到的数据
 *  @param error   错误信息
 */
typedef void(^completeBlock)(id respond, NSError *error);


@interface SLNetWork : NSObject


/**
 *  Get 请求
 *
 *  @param request  接口地址
 *  @param complete 完成后回调
 */
+ (void)getDataWithRequest:(NSString *)request complete:(completeBlock)complete;

/**
 *  Post 请求
 *
 *  @param parameters 参数
 *  @param postUrl    post请求地址
 *  @param complete   完成后回调
 */
+ (void)postDataWithParameters:(id)parameters postUrl:(NSString *)postUrl complete:(completeBlock)complete;


+ (void)uploadFileWithFileArr:(NSArray *)fileArr
        andFileInformationArr:(NSArray *)infoArr
                   andPostUrl:(NSString *)postUrl
                andParameters:(id)parameters
                     complete:(completeBlock)complete;


+ (void)upLoadImage:(NSData *)image sender:(NSString *)sender sendeName:(NSString *)sendeName complete:(completeBlock)complete;

+ (NSString *)backUid;

@end



@interface NSString (NetWork)


+ (NSString *)backUrlWithService:(NSString *)service methodName:(NSString *)methodName;


@end





